{include file="public/header" title="伯乐王教育后台管理" /}
    <section class="container-fluid" style="margin-top: 60px;">
		{include file="public/aside" news='active' }
		<div class="col-xs-9  col-xs-offset-3">
			<ol class="breadcrumb">
	          <li class="active"><a href="{:url('admin/index')}">首页</a></li>
	          <li >新闻</li>
	        </ol>
	        <div class="panel panel-default">
	         <div class="panel-heading">
		        <ul class="nav nav-tabs nav-justified" id="switch">
		            <li id='1'><a href="javascript:void(0)">新增新闻内容</a></li>
		            <li id='2' class="active"><a href="javascript:void(0)">编辑新闻内容</a></li>
		        </ul>
		     </div>
		     <div class="panel-body" id="changepanel">
		      <div class="panel1 show1">
		     	<table class="table table-bordered table-hover table-responsive">
		          <thead>
		          <tr>
		            <th>#</th>
		            <th>标题</th>
		            <th>创建时间</th>
		            <th>操作</th>
		            <th>状态</th>
		          </tr>
		          </thead>
		          	{volist name='list' id='user'}
		          <tr>
		            <td>{$user.id}</td>
		            <td>{$user.title}</td>
		            <td>{$user.create_time|date="y-m-d h:m",###}</td>
		            <td>
		              <button class="btn btn-default btn-primary" id="{$user.id}update">更新</button>
		              <button class="btn btn-default btn-danger" id="{$user.id}delete">删除</button>
		              {if($user.status==0)}
		              <button class="btn btn-default btn-success" id="{$user.id}fabu">发布</button>
		              {else /}
		              <button class="btn btn-default btn-danger" id="{$user.id}cancel">取消发布</button>
		              {/if}
		            </td>
		            {if($user.status==0)}
		            <td>未发布</td>
		            {else /}
		            <td>已发布</td>
					{/if}
		          </tr>
		            {/volist}
		        </table>
		        {$page}
		      </div>
		      <div class="modal fade" id="deleteModel" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel">
				  <div class="modal-dialog" role="document">
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				        <h4 class="modal-title" id="myModalLabel">警告</h4>
				      </div>
				      <div class="modal-body">
				        确认要执行删除操作？删除之后不可恢复！！！
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="deletp">确认</button>
				      </div>
				    </div>
				  </div>
				</div>
			<div class="modal fade" id="updateModel" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
				  <div class="modal-dialog" role="document">
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				        <h4 class="modal-title" id="myModalLabel">注意</h4>
				      </div>
				      <div class="modal-body">
				      	您将对数据进行更新,如有需要请自行备份当前数据!
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="updatp">确认</button>
				      </div>
				    </div>
				  </div>
				</div>
			<div class="modal fade" id="fabuModel" tabindex="-1" role="dialog" aria-labelledby="fabuModalLabel">
				  <div class="modal-dialog" role="document">
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				        <h4 class="modal-title" id="myModalLabel">注意</h4>
				      </div>
				      <div class="modal-body">
				      	您将对该内容进行发布!
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="fabtp">确认</button>
				      </div>
				    </div>
				  </div>
				</div>
			<div class="modal fade" id="cancelModel" tabindex="-1" role="dialog" aria-labelledby="cancelModalLabel">
				  <div class="modal-dialog" role="document">
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				        <h4 class="modal-title" id="myModalLabel">注意</h4>
				      </div>
				      <div class="modal-body">
				      	您将禁用该内容!
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="cancep">确认</button>
				      </div>
				    </div>
				  </div>
				</div>
		      <div class="panel2 hide1">
		      	<form id="news" method="post" action="{:url('news/add')}" enctype="multipart/form-data">
		          <div class="form-group">
		            <label class="control-label" for="title">文章标题</label>
		            <input type="text" name="title" required class="form-control" id="title" placeholder="新闻标题">
		          </div>
		          <div class="form-group">
		            <label class="control-label" for="backgroundimage">标题背景图片上传</label>
		            <input type="file" id="backgroundimage" name='backgroundimage'>
		            <p class="help-block">若不设定背景图片 则为默认背景图片。仅支持jpg,png,gif格式</p>
		            <img width="100%" id="demoimg" src="__PUBLIC__static/images/bgtitle.png" alt="">
		          </div>
		          <label class="control-label" for="editor">新闻主要内容</label>
		          <script id="editor" name="content" type="text/plain" style="height:500px;"></script>
		          <br>
		          <button type="submit" class="btn btn-default">提交审核</button>
		        </form>
		      </div>
		     </div>
	        </div>
        </div>
	</section>
	{load href="__PUBLIC__static/js/jquery.min.js"}
	{load href="__PUBLIC__static/js/jquery.validate.min.js"}
	{load href="__PUBLIC__static/js/layer.js"}
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__admin/js/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__admin/js/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__admin/js/ueditor/ueditor.all.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__admin/js/ueditor/lang/zh-cn/zh-cn.js"></script>
	<script data-main="__PUBLIC__admin/js/main1" src="__PUBLIC__admin/js/require.js"></script>
	{include file="public/footer"}